//
//  ViewController.m
//  WJAgroManagerDemo
//
//  Created by tqh on 2020/3/9.
//  Copyright © 2020 tqh. All rights reserved.
//

#import "ViewController.h"
#import "WJGiftGroupView.h"
#import "WJChatVoicePanelView.h"

@interface ViewController ()

@property (nonatomic,strong) WJChatVoicePanelView *voiceView;

@end

@implementation ViewController

- (void)dealloc {
    NSLog(@"销毁了~~~");
}

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor grayColor];
    
    self.voiceView = [[WJChatVoicePanelView alloc]initWithRecordPath:[self _getAudioOrVideoPath]];
    self.voiceView.frame = CGRectMake(0, self.view.frame.size.height - 208, self.view.frame.size.width, 208);
    [self.view addSubview:self.voiceView];
}

- (NSString *)_getAudioOrVideoPath
{
    NSString *path = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) firstObject];
    path = [path stringByAppendingPathComponent:@"EMDemoRecord"];
    if (![[NSFileManager defaultManager] fileExistsAtPath:path]) {
        [[NSFileManager defaultManager] createDirectoryAtPath:path withIntermediateDirectories:YES attributes:nil error:nil];
    }
    
    return path;
}


@end
